
// import TableList from "@components/templates/tablelist";
import TableList from "@components/templates/customtablelist";
import { HttpFinanceRemaind } from '@/service/api/views'
import { mapState,mapGetters } from "vuex";
export default {
    mixins: [TableList],
    data() {
        return {
            // totals: 0,
            isMixin: true,
            Tools: {show: true},
            Tabs: {show: true},
            formData:{
                search:{
                }
            },
            Searchs: {
                show: true,
                labelWidth: 120,
            },
            Plugins: {show: true},
            
            totalnum:'',
        }
    },
    methods: {
        ajaxRequest: HttpFinanceRemaind,
        handleOperates(params="", type,batch) {
            if(batch===true){
                params=(params||this.checkedData.join(','))+'';
                if(!params.length) return this.$Message.warning('请选择至少一条数据');
            }
            switch (type) {
                case 'add':
                    this.operate = {
                        show: true,
                        component: "compAdd",
                        title: "添加发货地址",
                        width: 660,
                        id:params,
                        type,
                        showFooter: false
                    }
                    break;
                case 'download':
                    this.handleWebfs(
                        process.env.VUE_APP_APIURL_SHIP + "/api/jwt/spl/freeze/export",{},
                        "download"
                    );
                    break;
                
            }
        },
    },
    computed: {
        ...mapGetters('dictionary',['getSysAllList']),
        TabsData(){
            return [
                {
                    name: this.$ct('global.common.all',{defaultValue:'全部'}),
                    key:'EQ_accountStatus',
                    val: null
                }, {
                    name: '正常',
                    key:'EQ_accountStatus',
                    val: "0"
                }, {
                    name: '欠费',
                    key:'EQ_accountStatus',
                    val: "1"
                }
            ]
        },
        // 搜索下拉框展示内容
        SearchsData() {
            return  [
                {
                    label: '组织',
                    tag: 'Select',
                    key: 'EQ_organizationId',
                    options:this.getSysAllList,
                    props:{
                        filterable:true,
                    },
                    show:true,
                },
            ]
        },
        // table的展示数据
        columns() {
            return [{
                title: "账户组织",
                key: "organizationName",
                sortable: true,
            }, {
                title: "状态",
                key: "accountStatus",
                render: (h, { row }) => {
                    return <div>
                        <Tag type="border" v-show={row.accountStatus === 0} color="success">正常</Tag>
                        <Tag type="border" v-show={row.accountStatus === 1} color="error">欠费</Tag>
                    </div>
                }
            }, {
                title: "冻结金额(USD)",
                key: "freezeTotalAmount",
                sortable: true,
            },{
                title: "账户余额(USD)",
                key: "totalAmount",
                sortable: true,
            }, {
                title: "可用余额(USD)",
                key: "availableAmount",
                sortable: true,
            }];
        },
        
    },

};
